/* 增强拖拽预览组件样式 */
.dragContainer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10000;
  overflow: hidden;
}

/* 主拖拽预览卡片 */
.dragPreview {
  position: absolute;
  border-radius: 8px;
  border: 2px solid;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transform-origin: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px;
  overflow: hidden;
  position: relative;
}

/* 拖拽状态样式 */
.dragPreview.dragging {
  transform: rotate(3deg) scale(1.05);
  animation: dragFloat 2s ease-in-out infinite;
}

.dragPreview.valid {
  transform: rotate(0deg) scale(1.1);
  box-shadow: 0 12px 48px rgba(40, 167, 69, 0.4);
  animation: validPulse 1s ease-in-out infinite;
}

.dragPreview.invalid {
  transform: rotate(-2deg) scale(0.95);
  box-shadow: 0 8px 32px rgba(220, 53, 69, 0.4);
  animation: invalidShake 0.5s ease-in-out infinite;
  filter: saturate(0.7);
}

/* 拖拽动画 */
@keyframes dragFloat {
  0%, 100% {
    transform: rotate(3deg) scale(1.05) translateY(0px);
  }
  50% {
    transform: rotate(3deg) scale(1.05) translateY(-4px);
  }
}

@keyframes validPulse {
  0%, 100% {
    transform: rotate(0deg) scale(1.1);
    box-shadow: 0 12px 48px rgba(40, 167, 69, 0.4);
  }
  50% {
    transform: rotate(0deg) scale(1.15);
    box-shadow: 0 16px 64px rgba(40, 167, 69, 0.6);
  }
}

@keyframes invalidShake {
  0%, 100% {
    transform: rotate(-2deg) scale(0.95) translateX(0px);
  }
  25% {
    transform: rotate(-2deg) scale(0.95) translateX(-2px);
  }
  75% {
    transform: rotate(-2deg) scale(0.95) translateX(2px);
  }
}

/* 卡片内容 */
.previewContent {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.previewIcon {
  font-size: 18px;
  line-height: 1;
  animation: iconSpin 3s linear infinite;
}

@keyframes iconSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.previewText {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.roomNumber {
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.statusLabel {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.9;
  line-height: 1;
}

/* 状态指示器 */
.statusIndicator {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: bold;
  margin-left: 4px;
}

.validIndicator {
  background: #28a745;
  color: white;
  animation: validBounce 0.6s ease-in-out infinite alternate;
}

.invalidIndicator {
  background: #dc3545;
  color: white;
  animation: invalidPulse 0.8s ease-in-out infinite;
}

.pendingIndicator {
  background: #ffc107;
  color: #212529;
  animation: pendingRotate 1s linear infinite;
}

@keyframes validBounce {
  from { transform: scale(1); }
  to { transform: scale(1.2); }
}

@keyframes invalidPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

@keyframes pendingRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 脉冲边框 */
.pulseRing {
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border: 2px solid;
  border-color: inherit;
  border-radius: inherit;
  opacity: 0.5;
  animation: ringPulse 2s ease-out infinite;
}

@keyframes ringPulse {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

/* 拖拽轨迹 */
.trailPoint {
  position: absolute;
  width: 8px;
  height: 8px;
  background: radial-gradient(circle, rgba(102, 126, 234, 0.8) 0%, rgba(102, 126, 234, 0.2) 100%);
  border-radius: 50%;
  animation: trailFade 0.5s ease-out forwards;
  pointer-events: none;
}

@keyframes trailFade {
  0% {
    opacity: 0.8;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.3);
  }
}

/* 放置区域预览 */
.dropZonePreview {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(40, 167, 69, 0.95);
  color: white;
  padding: 12px 20px;
  border-radius: 25px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(40, 167, 69, 0.4);
  backdrop-filter: blur(12px);
  animation: slideUpIn 0.3s ease-out;
}

@keyframes slideUpIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.dropZoneAnimation {
  position: relative;
  width: 24px;
  height: 24px;
}

.dropZoneRipple {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 2px solid white;
  border-radius: 50%;
  opacity: 0;
  animation: ripple 2s ease-out infinite;
}

.dropZoneRipple:nth-child(2) {
  animation-delay: 0.5s;
}

.dropZoneRipple:nth-child(3) {
  animation-delay: 1s;
}

@keyframes ripple {
  0% {
    transform: scale(0.3);
    opacity: 1;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

.dropZoneText {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

/* 无效放置提示 */
.invalidDropHint {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(220, 53, 69, 0.95);
  color: white;
  padding: 12px 20px;
  border-radius: 25px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(220, 53, 69, 0.4);
  backdrop-filter: blur(12px);
  animation: slideUpIn 0.3s ease-out;
}

.invalidIcon {
  font-size: 18px;
  animation: invalidShakeIcon 0.5s ease-in-out infinite;
}

@keyframes invalidShakeIcon {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

.invalidText {
  font-size: 14px;
  font-weight: 600;
}

/* 拖拽提示信息 */
.dragHint {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  backdrop-filter: blur(8px);
  animation: slideDownIn 0.3s ease-out;
}

@keyframes slideDownIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.hintIcon {
  font-size: 16px;
}

.hintText {
  white-space: nowrap;
}

/* 磁吸效果指示器 */
.snapIndicator {
  position: fixed;
  width: 40px;
  height: 40px;
  pointer-events: none;
  animation: snapFloat 1s ease-in-out infinite;
}

.snapRing {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 3px solid #28a745;
  border-radius: 50%;
  animation: snapRingPulse 1.5s ease-out infinite;
}

.snapDot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  background: #28a745;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: snapDotPulse 1s ease-in-out infinite alternate;
}

@keyframes snapFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-6px); }
}

@keyframes snapRingPulse {
  0% {
    transform: scale(0.5);
    opacity: 1;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

@keyframes snapDotPulse {
  from { transform: translate(-50%, -50%) scale(1); }
  to { transform: translate(-50%, -50%) scale(1.5); }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .dragPreview {
    padding: 6px;
  }

  .previewIcon {
    font-size: 16px;
  }

  .roomNumber {
    font-size: 11px;
  }

  .statusLabel {
    font-size: 9px;
  }

  .statusIndicator {
    width: 16px;
    height: 16px;
    font-size: 10px;
  }

  .dropZonePreview,
  .invalidDropHint {
    padding: 10px 16px;
    bottom: 16px;
  }

  .dropZoneText,
  .invalidText {
    font-size: 13px;
  }

  .dragHint {
    padding: 6px 12px;
    font-size: 12px;
    top: 16px;
  }
}

@media (max-width: 480px) {
  .dragPreview {
    padding: 4px;
  }

  .previewContent {
    gap: 6px;
  }

  .previewIcon {
    font-size: 14px;
  }

  .roomNumber {
    font-size: 10px;
  }

  .statusLabel {
    font-size: 8px;
  }

  .dropZonePreview,
  .invalidDropHint {
    padding: 8px 12px;
    max-width: 280px;
  }

  .dropZoneText,
  .invalidText {
    font-size: 12px;
  }

  .dragHint {
    padding: 4px 8px;
    font-size: 11px;
  }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
  .dragPreview {
    border-width: 3px;
  }

  .statusIndicator {
    border: 2px solid white;
  }

  .trailPoint {
    border: 1px solid rgba(102, 126, 234, 0.8);
  }
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
  .dragPreview,
  .trailPoint,
  .dropZoneRipple,
  .statusIndicator,
  .pulseRing,
  .snapIndicator {
    animation: none;
  }

  .dragPreview.dragging {
    transform: scale(1.05);
  }

  .dragPreview.valid {
    transform: scale(1.1);
  }

  .dragPreview.invalid {
    transform: scale(0.95);
  }
}
